*THIS IS THE DO FILE FOR FAILS AND KRIECKHAUS, 'COLONIALISM, PROPERTY RIGHTS, AND THE MODERN WORLD INCOME DISTRIBUTION'
*FORTHCOMING AT BRITISH JOURNAL OF POLITICAL SCIENCE

clear
version 9 
set more off

macro drop _all

global dir1 "C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\Data and Code for Posting on Web\FailsKrieckhausBJPSdata.dta"

use "$dir1", replace


*****
*****


*1) DESCRIBE VARIABLES
label var countryn "country name"
label var newcode "country code"
label var isocode "country alpha code"
label var samp01 "AJR 2001 sample identifier"
label var samp02 "AJR 2002 sample identifier"
label var risk "Expropriation risk"
label var mort "Settler mortality main estimate"
label var logmort0 "Log of settler mortality"
label var loggdp "Log income per capita, 1995"
label var den1500 "Population density in 1500"
label var lden1500 "Log population density in 1500"
label var urb1500 "Urbanization in 1500"
label var settlers "Settlers as % of Population"
label var nbcs "Neo-Britains and City-States identifier"
label var neobrit "Neo-Britains identifier"
label var lat "Latitude"
label var brit "British colony"
label var france "French colony"
label var riskFK "Expropriation Risk - FailsKrieckhaus calculation"
label var PWTgdp "Penn World Tables log income per capita, 1995"
label var WBgdp "World Bank log income per capita, 1995"
label var combrisk "Combined Expropriation Risk"
label var combgdp "Combined income per capita, 1995"

des
sum


*****
*****


*2) CREATE FIGURE 1, PANELS A, B, AND C

****Could change (or delete) the saving command on these
* use the variable combgdp for the first two graphs

set scheme s2mono, perm

reg combgdp urb1500
twoway (scatter combgdp urb1500, mlabel(isocode)) (lfit combgdp urb1500), title("AJR 2002 Figure 1") ///
	xtitle("Urbanization in 1500") ytitle("Log GDP per capita, PPP, 1995") legend(off) ///
	ylabel(7(1)10, nogrid) xlabel(0(5)20, nogrid) note("Coef. = -0.08, T = -2.97, N = 40") ///
	scheme(s2mono) graphregion(fcolor(white)) ///
	saving("C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F1_B", replace)

reg combgdp lden1500
twoway (scatter combgdp lden1500, mlabel(isocode)) (lfit combgdp lden1500), title("AJR 2002 Figure 2") ///
	xtitle("Log Population Density in 1500") ytitle("Log GDP per capita, PPP, 1995") legend(off) ///
	ylabel(6(1)10, nogrid) xlabel(-5(1)5, nogrid) note("Coef. = -0.38, T = -6.69, N = 87") ///
	scheme(s2mono) graphregion(fcolor(white)) ///
	saving("C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F1_C", replace)

reg loggdp logmort0
twoway (scatter loggdp logmort0, mlabel(isocode)) (lfit loggdp logmort0), title("AJR 2001 Figure 1") ///
	xtitle("Log of Settler Mortality") ytitle("Log GDP per capita, PPP, 1995") legend(off) ///
	ylabel(4(2)10, nogrid) xlabel(2(2)8, nogrid) note("Coef. = -0.57, T = -7.33, N = 64") ///
	scheme(s2mono) graphregion(fcolor(white)) ///
	saving("C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F1_A", replace)

graph combine "C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F1_A" ///
	"C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F1_B" ///
	"C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F1_C"


*****
*****


*3) CREATE TABLES 1, 2

*Table 1, Ten highest institutions in AJRs 2001 base sample
hilo risk countryn brit france if samp01==1

*Table 2, Highest prevalence of European Settlers in AJRs 2001 base sample
list countryn settlers if samp01==1 & brit_1==1


*****
*****


*4) OTHER ITEMS MENTIONED IN TEXT OF PAPER

*relationship between settlers and property rights in full, reduced sample

reg risk settlers
reg risk settlers if neobrit!=1

*for a claim made in the conclusion of the paper
reg combgdp lden1500 if neobrit!=1


*****
*****


*5) CREATE FIGURE 2 -- COMBINED FULL SAMPLE AND DROPPING NEO-BRITAIN' AND CITY-STATES

reg combrisk urb1500
reg combrisk urb1500 if nbcs!=1
twoway (scatter combrisk urb1500, mlabel(isocode)) (lfit combrisk urb1500, clpattern(solid)) ///
	(scatter combrisk urb1500 if nbcs!=1, mlabel(isocode)) (lfit combrisk urb1500 if nbcs!=1, clpattern(shortdash)) ///
	, title("Urbanization and Expropriation")  ///
	xtitle("Urbanization in 1500") ytitle("Average Expropriation Risk 1985-95") /// 
	ylabel(3(1)10, nogrid) xlabel(0(5)20, nogrid) note("      (1) Coef. = -0.10, T = -2.30, N = 39        (2) Coef. = -0.01, T = -0.38, N = 33") ///
	scheme(s2mono) graphregion(fcolor(white)) ///
	legend(order (2 "(1) Full Sample" 4 "(2) Dropping Neo-Britains and City-States") textfirst) ///
	saving("C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F2_urb", replace)


reg combrisk lden1500
reg combrisk lden1500 if nbcs!=1
twoway (scatter combrisk lden1500, mlabel(isocode)) (lfit combrisk lden1500, clpattern(solid)) ///
	(scatter combrisk lden1500 if nbcs!=1, mlabel(isocode)) (lfit combrisk lden1500 if nbcs!=1, clpattern(shortdash)) ///
	, title("Population Density and Expropriation") ///
	 xtitle("Log Population Density in 1500") ytitle("Average Expropriation Risk 1985-95") ///
	 ylabel(3(1)10, nogrid) xlabel(-5(1)5, nogrid) note("      (1) Coef. = -0.32, T = -3.15, N = 71        (2) Coef. = -0.01, T = -0.12, N = 65") ///
	 scheme(s2mono) graphregion(fcolor(white)) ///
	 legend(order (2 "(1) Full Sample" 4 "(2) Dropping Neo-Britains and City-States") textfirst) ///
	 saving("C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F2_popden", replace)


reg risk logmort0
reg risk logmort0 if nbcs!=1
twoway (scatter risk logmort0, mlabel(isocode)) (lfit risk logmort0, clpattern(solid)) ///
	(scatter risk logmort0 if nbcs!=1, mlabel(isocode)) (lfit risk logmort0 if nbcs!=1, clpattern(shortdash)) ///
	, title("AJR 2001 Figure 3")  ///
	xtitle("Log of Settler Mortality") ytitle("Average Expropriation Risk 1985-95") ///
	ylabel(3(1)10, nogrid) xlabel(2(2)8, nogrid) note("      (1) Coef. = -0.61, T = -4.83, N = 64        (2) Coef. = -0.30, T = -2.20, N = 59") ///
	scheme(s2mono) graphregion(fcolor(white)) ///
	legend(order (2 "(1) Full Sample" 4 "(2) Dropping Neo-Britains and City-States") textfirst) ///
	saving("C:\Documents and Settings\fails\My Documents\Research\AJR Colonialism with Krieckhaus\R&R Data and Analysis - June 2009\F2_mort", replace)

*for mention in ms about relationship when only 4 neo-britains are dropped
reg combrisk urb1500 if neobrit!=1
reg combrisk lden1500 if neobrit!=1


*****
*****

*6)  CREATE MANUSCRIPT TABLE 3, CLOSE REPLICATION AND SENSITIVITY OF AJR 2002 TABLE 7

reg combrisk urb1500
reg combrisk lden1500
reg combrisk urb1500 lden1500

reg combrisk urb1500 if neobrit!=1
reg combrisk lden1500 if neobrit!=1
reg combrisk urb1500 lden1500 if neobrit!=1

reg combrisk urb1500 if nbcs!=1
reg combrisk lden1500 if nbcs!=1
reg combrisk urb1500 lden1500 if nbcs!=1


*add latitude in as a control -- Appendix B Table 3B
reg combrisk urb1500 lat
reg combrisk lden1500 lat
reg combrisk urb1500 lden1500 lat

reg combrisk urb1500 lat if neobrit!=1
reg combrisk lden1500 lat if neobrit!=1
reg combrisk urb1500 lden1500 lat if neobrit!=1

reg combrisk urb1500 lat if nbcs!=1
reg combrisk lden1500 lat if nbcs!=1
reg combrisk urb1500 lden1500 lat if nbcs!=1

*****
*****


*7) CREATE MANUSCRIPT TABLE 4, A HYBRID REPLICATION OF AJR 2001 TABLE 4 AND 5

* SPECIFICALLY, THE TABLE GOES IN THIS ORDER:
* (1)T4COL1, (2)T4COL2, (3)T5COL2, (4)T4COL3, (5)T4COL4, (6)#3 - neobrit, (7)#1-nbcs, (8)#2-nbcs, (9)#3-nbcs

* Cluster on mortality (the results reported in Table 4 of the paper)
** (1) 
ivreg2 loggdp (risk=logmort0), first cluster(logmort0) 
** (2)
ivreg2 loggdp lat (risk=logmort0), first cluster(logmort0) 
** (3)
ivreg2 loggdp lat brit france (risk=logmort0), first cluster(logmort0)
** (4) 
ivreg2 loggdp (risk=logmort0) if neobrit!=1, first cluster(logmort0)
** (5) 
ivreg2 loggdp lat (risk=logmort0) if neobrit!=1, first cluster(logmort0)
** (6) 
ivreg2 loggdp lat brit france (risk=logmort0) if neobrit!=1, first cluster(logmort0)
** (7)
ivreg2 loggdp (risk=logmort0) if nbcs!=1, first cluster(logmort0)
** (8)
ivreg2 loggdp lat (risk=logmort0) if nbcs!=1, first cluster(logmort0)
** (9)
ivreg2 loggdp lat brit france (risk=logmort0) if nbcs!=1, first cluster(logmort0)


* No cluster on mortality (reported in Table 4B on Appendix B)
** (1) 
ivreg2 loggdp (risk=logmort0), first
** (2)
ivreg2 loggdp lat (risk=logmort0), first
** (3)
ivreg2 loggdp lat brit france (risk=logmort0), first
** (4) 
ivreg2 loggdp (risk=logmort0) if neobrit!=1, first
** (5) 
ivreg2 loggdp lat (risk=logmort0) if neobrit!=1, first
** (6) 
ivreg2 loggdp lat brit france (risk=logmort0) if neobrit!=1, first
** (7)
ivreg2 loggdp (risk=logmort0) if nbcs!=1, first
** (8)
ivreg2 loggdp lat (risk=logmort0) if nbcs!=1, first
** (9)
ivreg2 loggdp lat brit france (risk=logmort0) if nbcs!=1, first


*****
*****

*8) Create Table 5, Anderson-Rubin confidence intervals (with clustering)

** (Model 1)
ivreg2 loggdp (risk=logmort0), first cluster(logmort0) 
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.9
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.655
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0, cluster(logmort0)

* (0.66 , 1.83)


** (Model 2)
ivreg2 loggdp lat (risk=logmort0), first cluster(logmort0) 
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=2.83
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.62
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat, cluster(logmort0)

* (0.62 , 2.83)


** (Model 3)
ivreg2 loggdp lat brit france (risk=logmort0), first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=5.8
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat brit france, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.64
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat brit france, cluster(logmort0)

* (0.64 , 5.8)


** (Model 4) 
ivreg2 loggdp (risk=logmort0) if neobrit!=1, first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=7.30
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 if neobrit!=1, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.72
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 if neobrit!=1, cluster(logmort0)


* (0.72 , 7.30)


** (Model 5) 
ivreg2 loggdp lat (risk=logmort0) if neobrit!=1, first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=15.95
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat if neobrit!=1, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.67
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat if neobrit!=1, cluster(logmort0)


* (0.67 , 15.95)


** (Model 6) 
ivreg2 loggdp lat brit france (risk=logmort0) if neobrit!=1, first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=-4.1
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat brit france if neobrit!=1, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.66
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat brit france if neobrit!=1, cluster(logmort0)

* (-4.1, 0.66)  Disjoint b/c crosses 0


** (Model 7)
ivreg2 loggdp (risk=logmort0) if nbcs!=1, first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=-15.50
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 if nbcs!=1, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.68
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 if nbcs!=1, cluster(logmort0)

* (-15.50, 0.68) Disjoint b/c crosses 0


** (Model 8)
ivreg2 loggdp lat (risk=logmort0) if nbcs!=1, first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=-3.51
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat if nbcs!=1, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.585
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat if nbcs!=1, cluster(logmort0)

* (-3.51, 0.59) Disjoint b/c crosses 0


** (Model 9)
ivreg2 loggdp lat brit france (risk=logmort0) if nbcs!=1, first cluster(logmort0)
capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=-0.99
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat brit france if nbcs!=1, cluster(logmort0)

capture drop beta_tilde
capture drop y_tilde
gen beta_tilde=0.53
gen y_tilde = loggdp-beta_tilde*risk
reg y_tilde logmort0 lat brit france if nbcs!=1, cluster(logmort0)

* (-0.99, 0.53) Disjoint b/c crosses 0













